package com.it.park.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.it.park.client.service.ArticleService;
import com.it.park.dao.ArticleMapper;
import com.it.park.model.Article;
import com.it.park.model.ArticleVo;

@Service("articleService")
public class ArticleServiceImpl extends BaseServiceImpl< Article> implements ArticleService {
	
	@Autowired
	private ArticleMapper articleMapper;
	
	@Override
	public boolean insert(Article article) {
		return articleMapper.insert(article) == 1;
	}

	@Override
	public List<Article> hotList() {
		return articleMapper.hotList();
	}

	@Override
	public Integer updateClickRate(Integer id) {
		return articleMapper.updateClickRate(id);
	}

	@Override
	public List<Article> listRelationUser(Map<String,Object> map) {
		return  articleMapper.listRelationUser(map);
	}

	@Override
	public Integer updateComment(Map<String,Object> map) {
		
		return articleMapper.updateComment(map);
	}

	@Override
	public boolean deleteByPrimaryKey(Integer id) {
		return articleMapper.deleteByPrimaryKey(id)==1;
	}

	@Override
	public boolean insertSelective(Article record) {
		return articleMapper.insertSelective(record)==1;
	}

	@Override
	public Article selectByPrimaryKey(Integer id) {
		return articleMapper.selectByPrimaryKey(id);
	}

	@Override
	public boolean updateByPrimaryKeySelective(Article record) {
		return articleMapper.updateByPrimaryKeySelective(record)==1;
	}

	@Override
	public boolean updateByPrimaryKey(Article record) {
		return articleMapper.updateByPrimaryKey(record)==1;
	}

	@Override
	public List<Article> selectPagination(Map<String, Object> map) {
		return articleMapper.selectPagination(map);
	}

	@Override
	public Integer selectTotal(Map<String, Object> map) {
		return articleMapper.selectTotal(map);
	}

	@Override
	public List<Article> selectAll() {
		return articleMapper.selectAll();
	}

	@Override
	public List<Article> selectByCategoryType(Map<String,Object> map) {
		return articleMapper.selectByCategoryType(map);
	}

	@Override
	public List<Article> selectByType(Map<String, Object> map) {
		return articleMapper.selectByType(map);
	}

	@Override
	public Integer selectByTypeTotal(Integer articleTypeId) {
		return articleMapper.selectByTypeTotal(articleTypeId);
	}

	@Override
	public boolean putToRecycle(Integer id) {
		return articleMapper.putToRecycle(id)==1;
	}

	@Override
	public boolean setToDraft(Integer id) {
		return articleMapper.setToDraft(id)==1;
	}

	@Override
	public boolean recoverFromRecycle(Integer id) {
		return articleMapper.recoverFromRecycle(id)==1;
	}

	@Override
	public List<Article> selectFromRecycle(Integer userId) {
		return articleMapper.selectFromRecycle(userId);
	}

	@Override
	public List<Article> selectFromDraft(Integer userId) {
		return articleMapper.selectFromDraft(userId);
	}

	@Override
	public Integer selectByCategoryTypeTotal(Integer categoryType) {
		return articleMapper.selectByCategoryTypeTotal(categoryType);
	}

	@Override
	public List<Article> selectOtherInterested(Integer id) {
		return articleMapper.selectOtherInterested(id);
	}

	@Override
	public void updateReview(Article article) {
		articleMapper.updateReview(article);
	}

	@Override
	public boolean updateByPrimaryKeyWithBLOBs(Article record) {
		return false;
	}

	@Override
	public List<ArticleVo> selectNewArticleComment() {
		return articleMapper.selectNewArticleComment();
	}

	@Override
	public List<Article> selectPagination(Article t) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Integer selectTotal(Article t) {
		// TODO Auto-generated method stub
		return null;
	}

}
